package com.leetcode.algorithm.y22.m08.w1;

import java.util.Arrays;

/**
 * 1374. 生成每种字符都是奇数个的字符串
 * 
 * https://leetcode.cn/problems/generate-a-string-with-characters-that-have-odd-counts/
 * 
 * @author jie.deng
 *
 */
class Question1374Solution01 {
	
	public String generateTheString(int n) {
		char[] arr = new char[n];
		Arrays.fill(arr, 'a');
		if (n % 2 == 0) {
			arr[n - 1] = 'b';
		}
		return new String(arr);
	}
}